﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace _042082.UserControls
{
    public partial class urlKhachHang : UserControl
    {
        public urlKhachHang()
        {
            InitializeComponent();
            // Khi load mặc định là tìm kiếm 
            txt_KHDD.Enabled = false;
            lbl_KHDD.Enabled = false;
            chk_KHDD.Enabled = false;
            btAdd.Enabled = false;
            btDelete.Enabled = false;
            btUpdate.Enabled = false;

        }
        private void ckhKHMOI_CheckedChanged(object sender, EventArgs e)
        {
            if (ckhKHMOI.Checked == true)
            {
                cmbSearch.Enabled = false;
                btSearch.Enabled = false;
                txt_KHDD.Enabled = true;
                lbl_KHDD.Enabled = true;
                chk_KHDD.Enabled = true;
                if (chk_KHDD.Checked == true)
                    chk_KHDD.Checked = false;
            }
            else
            {
                cmbSearch.Enabled = true;
                btSearch.Enabled = true;
                txt_KHDD.Enabled = false;
                lbl_KHDD.Enabled = false;
                chk_KHDD.Enabled = false;
            }

        }

        private void chk_KHDD_CheckedChanged(object sender, EventArgs e)
        {
            if (chk_KHDD.Checked == true)
            {
                lbl_KHDD.Enabled = false;
                txt_KHDD.Enabled = false;
            }
            else
            {
                lbl_KHDD.Enabled = true;
                txt_KHDD.Enabled = true;
            }
        }

        private void plKhachHang_Click(object sender, EventArgs e)
        {
            
        }
        public static void OnLoad_frmHoaDon()
        {
            txt_KHDD.Visible = false;
            chk_KHDD.Visible = false;
            ckhKHMOI.Visible = false;
            lbl_KHDD.Visible = false;
        }
        public static void OnLoad_frmKhachHang()
        {
            ckhKHMOI.Checked = true;
            //ckhKHMOI.Enabled = false;
        }
    }
}
